import Vue from 'vue'
import Router from 'vue-router'
import Index from '@/components/index'
import allgoods from '../components/allgoods/allgoods.vue'
Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/',
      name: 'shouye',
      component: resolve => {
        require(['../components/index.vue'], resolve)
      }
    },
    {/*首页路由*/
      path: '/index',
      name: 'index',
      component: resolve => {
        require(['../components/index.vue'], resolve)
      }
    },
    {/*全部商品路由*/
      path: '/goods',
      name: 'goods',
      component: resolve => {
        require(['../components/allgoods/allgoods.vue'], resolve)
      }

    },
    {
      /*购物车路由*/
      path: '/shopping',
      name: 'shopp',
      component: resolve => {
        require(['../components/shopping/shopp.vue'], resolve)
      }
    },
    {/*订单确认路由*/
      path:'/order',
      name:'order',
      component:resolve =>{
        require(['../components/shopping/order.vue'], resolve)
      }
    },
    {
      path: '*',
      redirect: '/index'
    }

  ]
})
